Definition
Elasticity of Substitution is the elasticity of the ratio of two inputs / goods to a production / utility function with respect to the ratio of their marginal products / utilities.
It is also called full elasticity of substitution.
In competitive market, it measures the percentage change in the ratio of two inputs used in response to a percentage change in their prices
Elasticity of substitution measures the curvature of an isoquant (for production function), and the substitutability between inputs / goods: how easy it is to substitute one input / good for the other.
Calculation
For utility
Suppose the utility over consumption set is
, let:

Then elasticity of substitution is:
For production
suppose the production function is
.
Then elasticity of substitution is:
MRTS is marginal rate of technical substitution.
Note: That is the two different aspect of elasticity of substitution (one associated with price, the other does not) that I am confused about.
My understanding: according to the definition "In competitive market, it measures the percentage change in the ratio of two inputs used in response to a percentage change in their prices", here ln() gives the percentage change. And when the market is prefect competitive, we have the price of input equals to the marginal productivity, so
, then the function above becomes the one I am familiar with (using price)